<!DOCTYPE html>
<html lang="en">
<head>
    <title>Title</title>
    <script type="text/javascript" src="/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="/farmer.messager.js"></script>
    <script>
        function testAlert(){
            $.messager.alert("提示","测试");
        }

        function testLoading(){
            $.messager.loading("加载中",2000)
        }

        function testConfirm(){
            $.messager.confirm("提示","确定吗？",function(y){
                if(y){
                    $.messager.alert("提示","确定")
                }else{
                    $.messager.alert("提示","取消")
                }
            })
        }

        function testPromp(){
            $.messager.promp("提示","输入值",function(y,val){
                if(y){
                    $.messager.alert("提示","输入了：" +val)
                }else{
                    $.messager.alert("提示","取消输入")
                }
            })
        }

        function testArea(){
            $.messager.prompArea("提示","输入值",function(y,val){
                if(y){
                    $.messager.alert("提示","输入了：" +val)
                }else{
                    $.messager.alert("提示","取消输入")
                }
            })
        }

        function testProcess(){
            var num = 0;
            $.messager.processBar("进度",function(postCall){
                num += 20;
                postCall(num)
            },function(y){
                if(y){
                    $.messager.alert("提示","完成")
                }else{
                    $.messager.alert("提示","出错了")
                }
            },2000)
        }

        function testProcess1(){
            var num = 0;
            $.messager.processBar("进度",function(postCall){
                num += 20;
                if(num === 80){
                    throw "错误"
                }
                postCall(num)
            },function(y){
                if(y){
                    $.messager.alert("提示","完成")
                }else{
                    $.messager.alert("提示","出错了")
                }
            },2000)
        }
    </script>
</head>
<body>
<button onclick="testLoading()">loading</button>
<button onclick="testAlert()">alert</button>
<button onclick="testConfirm()">confirm</button>
<button onclick="testPromp()">promp</button>
<button onclick="testArea()">area</button>
<button onclick="testProcess()">process</button>
<button onclick="testProcess1()">processErr</button>
</body>
</html>